<?php

$fbid = mysql_real_escape_string($fbid);

$result = mysql_query("SELECT * FROM site_user_meta WHERE `fbid`='$fbid'");
if(!$result) echo mysql_error();

if(mysql_numrows($result) == 0)
{
	echo '<div class="err_box"> That user is not on Gausipp yet! </div>';
}
else  // displaying the details about the user
{
echo '<div style="padding:20px;">';	
// menu to view facebook prpofile and message 	
echo '<div style="float:right;width:200px">';
echo '
	<div class="medium-menu" > 
	<div class="menu-icon"><img src="images/icons/facebook.png" /></div>
	<div class="menu-text"><a href="http://facebook.com/'.$fbid.'" target="_blank">View on FB</a></div>
	<div class="clear"></div>
	</div>';
	/*
if($user != $fbid) {
echo ' 
	<div class="medium-menu" > 
	<div class="menu-icon"><img src="images/icons/messenger.png" /></div>
	<div class="menu-text"><a href="index.php?cat=msg&fbid='.$fbid.'">Send message</a></div> 
	<div class="clear"></div>
	</div>';
}
*/
echo '</div>';

// user information
echo '<div style="width:400px">';
fetch_user_details($fbid);
echo '</div><br>';

if($fbid == $user)
{
	echo '<div class="err_box"> Don\'t worry! Other people cannot view the anonymous posts that you made. Only you can.</div><br><Br>';
}  

	?>	
	<script type="text/javascript">
	$(function(){
		init_stream(<?php echo $user; ?>,"profile_<?php if($user == $fbid) echo $fbid."_true"; else echo $fbid."_false"; ?>");
	});
	// this was to decide if anonymous posts are to be shown or not
	</script>
	
	<div id="stream_profile_<?php if($user == $fbid) echo $fbid."_true"; else echo $fbid."_false"; ?>"><img src="images/22.gif" /></div>
		
<?php
}
echo '</div>';
?>